import * as types from './mutation-types'

export const updateOrderAmount = (store, { currentTarget }) => {
  let amount = currentTarget.value
  store.commit(types.UPDATE_ORDER_AMOUNT, { amount })
}

export const updateInputValue = (store, { value, path }) => {
  store.commit(types.UPDATE_INPUT_VALUE, { value, path })
}

export const updateInstalmentsWhenTotalAmountChanged = (store, payload = {}) => {
  store.commit('updateInstalmentsWhenTotalAmountChanged', payload)
}

export const openRefundModal = (store, {} = {}) => {
  store.commit('OPEN_REFUND_MODAL')
}

export const closeRefundModal = ({ commit }, {} = {}) => commit('CLOSE_REFUND_MODAL')